/*
 *  This file is part of the SIRIUS libraries for analyzing MS and MS/MS data
 *
 *  Copyright (C) 2024 Bright Giant GmbH
 *
 *  This library is free software; you can redistribute it and/or
 *  modify it under the terms of the GNU Lesser General Public
 *  License as published by the Free Software Foundation; either
 *  version 2.1 of the License, or (at your option) any later version.
 *
 *  This library is distributed in the hope that it will be useful,
 *  but WITHOUT ANY WARRANTY; without even the implied warranty of
 *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
 *  Lesser General Public License for more details.
 *
 *  You should have received a copy of the GNU General Public License along with SIRIUS.  If not, see <http://www.gnu.org/licenses/>.
 *
 *  NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
 *  https://openapi-generator.tech
 *  Do not edit the class manually.
 */


package io.sirius.ms.sdk.model;

import java.util.Objects;
import java.util.Arrays;
import com.fasterxml.jackson.annotation.JsonInclude;
import com.fasterxml.jackson.annotation.JsonProperty;
import com.fasterxml.jackson.annotation.JsonCreator;
import com.fasterxml.jackson.annotation.JsonTypeName;
import com.fasterxml.jackson.annotation.JsonValue;
import io.sirius.ms.sdk.model.SpectralMatchingType;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;
import com.fasterxml.jackson.annotation.JsonPropertyOrder;
import com.fasterxml.jackson.annotation.JsonTypeName;

/**
 * User/developer friendly parameter subset for the Spectral library search tool.
 */
@JsonPropertyOrder({
  SpectralLibrarySearch.JSON_PROPERTY_ENABLED,
  SpectralLibrarySearch.JSON_PROPERTY_SPECTRA_SEARCH_D_BS,
  SpectralLibrarySearch.JSON_PROPERTY_PRECURSOR_DEVIATION_PPM,
  SpectralLibrarySearch.JSON_PROPERTY_MIN_SIMILARITY,
  SpectralLibrarySearch.JSON_PROPERTY_MIN_NUM_OF_PEAKS,
  SpectralLibrarySearch.JSON_PROPERTY_ENABLE_ANALOGUE_SEARCH,
  SpectralLibrarySearch.JSON_PROPERTY_MIN_SIMILARITY_ANALOGUE,
  SpectralLibrarySearch.JSON_PROPERTY_MIN_NUM_OF_PEAKS_ANALOGUE,
  SpectralLibrarySearch.JSON_PROPERTY_SCORING,
  SpectralLibrarySearch.JSON_PROPERTY_PEAK_DEVIATION_PPM
})
@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.14.0")
public class SpectralLibrarySearch {
  public static final String JSON_PROPERTY_ENABLED = "enabled";
  @jakarta.annotation.Nullable
  private Boolean enabled;

  public static final String JSON_PROPERTY_SPECTRA_SEARCH_D_BS = "spectraSearchDBs";
  @jakarta.annotation.Nullable
  private List<String> spectraSearchDBs;

  public static final String JSON_PROPERTY_PRECURSOR_DEVIATION_PPM = "precursorDeviationPpm";
  @jakarta.annotation.Nullable
  private Double precursorDeviationPpm;

  public static final String JSON_PROPERTY_MIN_SIMILARITY = "minSimilarity";
  @jakarta.annotation.Nullable
  private Float minSimilarity;

  public static final String JSON_PROPERTY_MIN_NUM_OF_PEAKS = "minNumOfPeaks";
  @jakarta.annotation.Nullable
  private Integer minNumOfPeaks;

  public static final String JSON_PROPERTY_ENABLE_ANALOGUE_SEARCH = "enableAnalogueSearch";
  @jakarta.annotation.Nullable
  private Boolean enableAnalogueSearch;

  public static final String JSON_PROPERTY_MIN_SIMILARITY_ANALOGUE = "minSimilarityAnalogue";
  @jakarta.annotation.Nullable
  private Float minSimilarityAnalogue;

  public static final String JSON_PROPERTY_MIN_NUM_OF_PEAKS_ANALOGUE = "minNumOfPeaksAnalogue";
  @jakarta.annotation.Nullable
  private Integer minNumOfPeaksAnalogue;

  public static final String JSON_PROPERTY_SCORING = "scoring";
  @jakarta.annotation.Nullable
  private SpectralMatchingType scoring;

  public static final String JSON_PROPERTY_PEAK_DEVIATION_PPM = "peakDeviationPpm";
  @jakarta.annotation.Nullable
  private Double peakDeviationPpm;

  public SpectralLibrarySearch() {
  }

  public SpectralLibrarySearch enabled(@jakarta.annotation.Nullable Boolean enabled) {
    
    this.enabled = enabled;
    return this;
  }

  /**
   * tags whether the tool is enabled
   * @return enabled
   */
  @jakarta.annotation.Nullable
  @JsonProperty(JSON_PROPERTY_ENABLED)
  @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)

  public Boolean isEnabled() {
    return enabled;
  }


  @JsonProperty(JSON_PROPERTY_ENABLED)
  @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
  public void setEnabled(@jakarta.annotation.Nullable Boolean enabled) {
    this.enabled = enabled;
  }

  public SpectralLibrarySearch spectraSearchDBs(@jakarta.annotation.Nullable List<String> spectraSearchDBs) {
    
    this.spectraSearchDBs = spectraSearchDBs;
    return this;
  }

  public SpectralLibrarySearch addSpectraSearchDBsItem(String spectraSearchDBsItem) {
    if (this.spectraSearchDBs == null) {
      this.spectraSearchDBs = new ArrayList<>();
    }
    this.spectraSearchDBs.add(spectraSearchDBsItem);
    return this;
  }

  /**
   * Structure Databases with Reference spectra to search in.  &lt;p&gt;  Defaults to BIO + Custom Databases. Possible values are available to Database API.
   * @return spectraSearchDBs
   */
  @jakarta.annotation.Nullable
  @JsonProperty(JSON_PROPERTY_SPECTRA_SEARCH_D_BS)
  @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)

  public List<String> getSpectraSearchDBs() {
    return spectraSearchDBs;
  }


  @JsonProperty(JSON_PROPERTY_SPECTRA_SEARCH_D_BS)
  @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
  public void setSpectraSearchDBs(@jakarta.annotation.Nullable List<String> spectraSearchDBs) {
    this.spectraSearchDBs = spectraSearchDBs;
  }

  public SpectralLibrarySearch precursorDeviationPpm(@jakarta.annotation.Nullable Double precursorDeviationPpm) {
    
    this.precursorDeviationPpm = precursorDeviationPpm;
    return this;
  }

  /**
   * Maximum allowed mass deviation in ppm for matching the precursor. If not specified, the same value as for the peaks is used.
   * @return precursorDeviationPpm
   */
  @jakarta.annotation.Nullable
  @JsonProperty(JSON_PROPERTY_PRECURSOR_DEVIATION_PPM)
  @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)

  public Double getPrecursorDeviationPpm() {
    return precursorDeviationPpm;
  }


  @JsonProperty(JSON_PROPERTY_PRECURSOR_DEVIATION_PPM)
  @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
  public void setPrecursorDeviationPpm(@jakarta.annotation.Nullable Double precursorDeviationPpm) {
    this.precursorDeviationPpm = precursorDeviationPpm;
  }

  public SpectralLibrarySearch minSimilarity(@jakarta.annotation.Nullable Float minSimilarity) {
    
    this.minSimilarity = minSimilarity;
    return this;
  }

  /**
   * Minimal spectral similarity of a spectral match to be considered a hit.
   * @return minSimilarity
   */
  @jakarta.annotation.Nullable
  @JsonProperty(JSON_PROPERTY_MIN_SIMILARITY)
  @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)

  public Float getMinSimilarity() {
    return minSimilarity;
  }


  @JsonProperty(JSON_PROPERTY_MIN_SIMILARITY)
  @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
  public void setMinSimilarity(@jakarta.annotation.Nullable Float minSimilarity) {
    this.minSimilarity = minSimilarity;
  }

  public SpectralLibrarySearch minNumOfPeaks(@jakarta.annotation.Nullable Integer minNumOfPeaks) {
    
    this.minNumOfPeaks = minNumOfPeaks;
    return this;
  }

  /**
   * Minimal number of matching peaks of a spectral match to be considered a hit.
   * @return minNumOfPeaks
   */
  @jakarta.annotation.Nullable
  @JsonProperty(JSON_PROPERTY_MIN_NUM_OF_PEAKS)
  @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)

  public Integer getMinNumOfPeaks() {
    return minNumOfPeaks;
  }


  @JsonProperty(JSON_PROPERTY_MIN_NUM_OF_PEAKS)
  @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
  public void setMinNumOfPeaks(@jakarta.annotation.Nullable Integer minNumOfPeaks) {
    this.minNumOfPeaks = minNumOfPeaks;
  }

  public SpectralLibrarySearch enableAnalogueSearch(@jakarta.annotation.Nullable Boolean enableAnalogueSearch) {
    
    this.enableAnalogueSearch = enableAnalogueSearch;
    return this;
  }

  /**
   * Enable analogue search in addition to the identity spectral library search
   * @return enableAnalogueSearch
   */
  @jakarta.annotation.Nullable
  @JsonProperty(JSON_PROPERTY_ENABLE_ANALOGUE_SEARCH)
  @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)

  public Boolean isEnableAnalogueSearch() {
    return enableAnalogueSearch;
  }


  @JsonProperty(JSON_PROPERTY_ENABLE_ANALOGUE_SEARCH)
  @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
  public void setEnableAnalogueSearch(@jakarta.annotation.Nullable Boolean enableAnalogueSearch) {
    this.enableAnalogueSearch = enableAnalogueSearch;
  }

  public SpectralLibrarySearch minSimilarityAnalogue(@jakarta.annotation.Nullable Float minSimilarityAnalogue) {
    
    this.minSimilarityAnalogue = minSimilarityAnalogue;
    return this;
  }

  /**
   * Minimal spectral similarity of a spectral match to be considered an analogue hit.
   * @return minSimilarityAnalogue
   */
  @jakarta.annotation.Nullable
  @JsonProperty(JSON_PROPERTY_MIN_SIMILARITY_ANALOGUE)
  @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)

  public Float getMinSimilarityAnalogue() {
    return minSimilarityAnalogue;
  }


  @JsonProperty(JSON_PROPERTY_MIN_SIMILARITY_ANALOGUE)
  @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
  public void setMinSimilarityAnalogue(@jakarta.annotation.Nullable Float minSimilarityAnalogue) {
    this.minSimilarityAnalogue = minSimilarityAnalogue;
  }

  public SpectralLibrarySearch minNumOfPeaksAnalogue(@jakarta.annotation.Nullable Integer minNumOfPeaksAnalogue) {
    
    this.minNumOfPeaksAnalogue = minNumOfPeaksAnalogue;
    return this;
  }

  /**
   * Minimal number of matching peaks of a spectral match to be considered an analogue hit.
   * @return minNumOfPeaksAnalogue
   */
  @jakarta.annotation.Nullable
  @JsonProperty(JSON_PROPERTY_MIN_NUM_OF_PEAKS_ANALOGUE)
  @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)

  public Integer getMinNumOfPeaksAnalogue() {
    return minNumOfPeaksAnalogue;
  }


  @JsonProperty(JSON_PROPERTY_MIN_NUM_OF_PEAKS_ANALOGUE)
  @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
  public void setMinNumOfPeaksAnalogue(@jakarta.annotation.Nullable Integer minNumOfPeaksAnalogue) {
    this.minNumOfPeaksAnalogue = minNumOfPeaksAnalogue;
  }

  public SpectralLibrarySearch scoring(@jakarta.annotation.Nullable SpectralMatchingType scoring) {
    
    this.scoring = scoring;
    return this;
  }

  /**
   * Get scoring
   * @return scoring
   */
  @jakarta.annotation.Nullable
  @JsonProperty(JSON_PROPERTY_SCORING)
  @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)

  public SpectralMatchingType getScoring() {
    return scoring;
  }


  @JsonProperty(JSON_PROPERTY_SCORING)
  @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
  public void setScoring(@jakarta.annotation.Nullable SpectralMatchingType scoring) {
    this.scoring = scoring;
  }

  public SpectralLibrarySearch peakDeviationPpm(@jakarta.annotation.Nullable Double peakDeviationPpm) {
    
    this.peakDeviationPpm = peakDeviationPpm;
    return this;
  }

  /**
   * NO LONGER SUPPORTED (IGNORED)  Maximum allowed mass deviation in ppm for matching peaks.
   * @return peakDeviationPpm
   * @deprecated
   */
  @Deprecated
  @jakarta.annotation.Nullable
  @JsonProperty(JSON_PROPERTY_PEAK_DEVIATION_PPM)
  @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)

  public Double getPeakDeviationPpm() {
    return peakDeviationPpm;
  }


  @JsonProperty(JSON_PROPERTY_PEAK_DEVIATION_PPM)
  @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
  public void setPeakDeviationPpm(@jakarta.annotation.Nullable Double peakDeviationPpm) {
    this.peakDeviationPpm = peakDeviationPpm;
  }


  @Override
  public boolean equals(Object o) {
    if (this == o) {
      return true;
    }
    if (o == null || getClass() != o.getClass()) {
      return false;
    }
    SpectralLibrarySearch spectralLibrarySearch = (SpectralLibrarySearch) o;
    return Objects.equals(this.enabled, spectralLibrarySearch.enabled) &&
        Objects.equals(this.spectraSearchDBs, spectralLibrarySearch.spectraSearchDBs) &&
        Objects.equals(this.precursorDeviationPpm, spectralLibrarySearch.precursorDeviationPpm) &&
        Objects.equals(this.minSimilarity, spectralLibrarySearch.minSimilarity) &&
        Objects.equals(this.minNumOfPeaks, spectralLibrarySearch.minNumOfPeaks) &&
        Objects.equals(this.enableAnalogueSearch, spectralLibrarySearch.enableAnalogueSearch) &&
        Objects.equals(this.minSimilarityAnalogue, spectralLibrarySearch.minSimilarityAnalogue) &&
        Objects.equals(this.minNumOfPeaksAnalogue, spectralLibrarySearch.minNumOfPeaksAnalogue) &&
        Objects.equals(this.scoring, spectralLibrarySearch.scoring) &&
        Objects.equals(this.peakDeviationPpm, spectralLibrarySearch.peakDeviationPpm);
  }

  @Override
  public int hashCode() {
    return Objects.hash(enabled, spectraSearchDBs, precursorDeviationPpm, minSimilarity, minNumOfPeaks, enableAnalogueSearch, minSimilarityAnalogue, minNumOfPeaksAnalogue, scoring, peakDeviationPpm);
  }

  @Override
  public String toString() {
    StringBuilder sb = new StringBuilder();
    sb.append("class SpectralLibrarySearch {\n");
    sb.append("    enabled: ").append(toIndentedString(enabled)).append("\n");
    sb.append("    spectraSearchDBs: ").append(toIndentedString(spectraSearchDBs)).append("\n");
    sb.append("    precursorDeviationPpm: ").append(toIndentedString(precursorDeviationPpm)).append("\n");
    sb.append("    minSimilarity: ").append(toIndentedString(minSimilarity)).append("\n");
    sb.append("    minNumOfPeaks: ").append(toIndentedString(minNumOfPeaks)).append("\n");
    sb.append("    enableAnalogueSearch: ").append(toIndentedString(enableAnalogueSearch)).append("\n");
    sb.append("    minSimilarityAnalogue: ").append(toIndentedString(minSimilarityAnalogue)).append("\n");
    sb.append("    minNumOfPeaksAnalogue: ").append(toIndentedString(minNumOfPeaksAnalogue)).append("\n");
    sb.append("    scoring: ").append(toIndentedString(scoring)).append("\n");
    sb.append("    peakDeviationPpm: ").append(toIndentedString(peakDeviationPpm)).append("\n");
    sb.append("}");
    return sb.toString();
  }

  /**
   * Convert the given object to string with each line indented by 4 spaces
   * (except the first line).
   */
  private String toIndentedString(Object o) {
    if (o == null) {
      return "null";
    }
    return o.toString().replace("\n", "\n    ");
  }

}

